package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.model.dto.TeachplanDto;
import com.xuecheng.content.model.po.Teachplan;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 课程计划 Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface TeachplanMapper extends BaseMapper<Teachplan> {
    public List<TeachplanDto> selectTreeNodes(long courseId);

    @Update("UPDATE teachplan SET orderby = #{nextOrderby} WHERE id = #{nowId}")
    public void updateOrderby(@Param("nextOrderby")int nextOrderby,@Param("nowId")Long nowId);

    @Update("UPDATE teachplan SET orderby = #{orderby} WHERE id = #{nextId}")
    public void  updateNextOrderby(@Param("orderby")int orderby, @Param("nextId")Long nextId);




}
